1. Technology Field
The present invention relates to a memory management method; particularly, the invention relates to a memory management method suitable for a rewritable non-volatile memory module, a memory control circuit unit using the method, and a memory storage apparatus using the method.
2. Description of Related Art
Digital cameras, mobile phones, and MP3 players have undergone rapid growth in recent years, so that consumers' demands for storage media have also increased drastically. Since a rewritable non-volatile memory module is characterized by non-volatility of data, the low power consumption, the small volume, the non-mechanical structure, and the fast reading and writing speed, the rewritable non-volatile memory is the most adaptable memory to be applied in a portable electronic product, e.g., a notebook computer. A solid state drive (SSD) is a storage apparatus which utilizes a flash memory as its memory storage medium. Therefore, the flash memory industry has become a very popular part of the electronic industry in recent years.
Wear leveling is one of the techniques adapted for managing a rewritable non-volatile memory module. The number of times of erasing data from and writing data into physical erasing units in the rewritable non-volatile memory module is limited, and the repeated erasing and writing operations on one single block may slow down the speed of data access and may even cause the physical erasing unit to be bad. The wear leveling technique aims at equally employing each physical erasing unit in the rewritable non-volatile memory module, so as to prevent “certain” physical erasing units from aging due to the overloaded use and the excessive use counts. Thereby, the error rate of data stored on these physical erasing units may be raised, the aging process is accelerated, and these physical erasing units may be labeled as defective physical erasing units and can no longer be used once the use counts of these physical erasing units reach the limited use counts guaranteed by manufacturers.
However, it is not necessary for each of the physical erasing units to be damaged after the use counts of these physical erasing units reach the limited use counts guaranteed by the manufacturers. Specifically, given that the use counts of certain physical erasing units reach the limit guaranteed by the manufacturer, some of these physical erasing units may have less number of bit errors, while the other physical erasing units may have more number of bit errors. If the physical erasing units with less number of bit errors can be protected by the error check and correcting (ECC) mechanism, the data errors on these physical erasing units may be corrected by means of the ECC mechanism, and such physical erasing units may still be used.
Conventionally, the number of times of writing or erasing data serves as a benchmark while the wear leveling technique is applied, and whether the use counts of the physical erasing units reach the limit guaranteed by the manufacturer and whether these physical erasing units can be further used are not taken into consideration. As long as the use counts of the physical erasing units reach the limit, these physical erasing unit are labeled as defective physical erasing units and can no longer be used. Thereby, the lifespan of the rewritable non-volatile memory module is shortened.